home *** CD-ROM | disk | FTP | other *** search
/ SGI O2 Out of Box Experience 2.2 / SGI O2 Out of Box Experience 2.2.iso / cgi-bin / nph-startRegistration.cgi < prev    next >
Text File  |  1998-05-26  |  6KB  |  150 lines

  1. #!/bin/sh
  2.  
  3. #**************************************************************************
  4. #*                                                                        *
  5. #*            Copyright (c) 1993 Silicon Graphics, Inc.                   *
  6. #*                      All Rights Reserved                               *
  7. #*                                                                        *
  8. #*         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI             *
  9. #*                                                                        *
  10. #* The copyright notice above does not evidence any actual of intended    *
  11. #* publication of such source code, and is an unpublished work by Silicon *
  12. #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
  13. #* the property of Silicon Graphics, Inc. Any use, duplication or         *
  14. #* disclosure not specifically authorized by Silicon Graphics is strictly *
  15. #* prohibited.                                                            *
  16. #*                                                                        *
  17. #* RESTRICTED RIGHTS LEGEND:                                              *
  18. #*                                                                        *
  19. #* Use, duplication or disclosure by the Government is subject to         *
  20. #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in   *
  21. #* Technical Data and Computer Software clause at DFARS 52.227-7013,      *
  22. #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR     *
  23. #* Supplement. Unpublished - rights reserved under the Copyright Laws of  *
  24. #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N.       *
  25. #* Shoreline Blvd., Mountain View, CA 94039-7311                          *
  26. #**************************************************************************
  27.  
  28. server_protocol=$SERVER_PROTOCOL;
  29. server_software=$SERVER_SOFTWARE;
  30.  
  31. /sbin/echo "$server_protocol 200 OK"
  32. /sbin/echo "Server: $server_software"
  33. /sbin/echo "Content-Type: text/html";
  34. /sbin/echo "Expires: 0\n";
  35.  
  36.  
  37. # Print header
  38. /sbin/echo "<html>\n";
  39. /sbin/echo "<body bgcolor=#000000 text=#996688>\n";
  40. /sbin/echo "<h2>Starting EndUser Registration...</h2>\n";
  41. /sbin/echo "<P>\n";
  42. /sbin/echo "<FONT SIZE="3">It may take up to 30 seconds to start this tool.</FONT>\n";
  43. /sbin/echo "<BR>\n";
  44. /sbin/echo "<FONT SIZE="3">Please be patient.</FONT>\n";
  45. /sbin/echo "</P>\n";
  46. /sbin/echo "</body>\n";
  47. /sbin/echo "</html>\n";
  48.  
  49.  
  50. DISPLAY=:0.0
  51. export DISPLAY
  52.  
  53. #  Because we are starting from CGI, we need to reset the
  54. #    $HOME so that Netscape can find the preferences file and
  55. #    cache directory.
  56.  
  57. HOME=/tmp/.custreg; export HOME
  58. TMPDIR=/tmp; export TMPDIR
  59.  
  60. # Assuming Navigator is 3.X and Communicator is 4.X
  61. NSVERSION=`/usr/sbin/showprods -D1 netscape netscape_gold |egrep "Navigator|Communicator"`
  62.  
  63.  
  64. # First thing, check to see if we've already started Cust Reg
  65. #    If so, exit.  If not, continue on.......
  66. # Note that this section is very specific, so if the calling string changes,
  67. #    we must change this conditional as well.
  68.  
  69. found=`/sbin/ps -ef | grep "Register_To_Win" | grep -v grep`
  70. if [ -n "$found"  ]; then
  71.    /usr/bin/X11/xconfirm -c -B "OK" -icon progress \
  72.      -font '-*-helvetica-medium-r-narrow--19-*-*-*-p-83-iso8859-1' \
  73.      -t "Customer Registration has already been started..."  > /dev/null
  74.    exit
  75. fi
  76.  
  77. # create the .netscape/cache directory so we don't get told that it
  78. #    created one for us
  79. if [ ! -d $HOME/.netscape/cache ]; then
  80.     /sbin/mkdir -p $HOME/.netscape/archive $HOME/.netscape/cache $HOME/.netscape/plugins
  81. fi
  82.  
  83. # Get OutOfBox's copy of the preferences file for us to use
  84. case "$NSVERSION" in
  85.    *Communicator*)
  86.       /bin/cp /CDROM/misc/cgiPreferences4.js $HOME/.netscape/preferences.js
  87.       ;;
  88.    *Navigator*|*)
  89.       /bin/cp /CDROM/misc/cgiPreferences $HOME/.netscape/preferences
  90.       ;;
  91. esac
  92.  
  93.  
  94. # Get OutOfBox's plugin.list file - this cuts significant time off of startup
  95. #    Use OutOfBox's list becuase it will be current - it was just created...
  96. /bin/cp /usr/people/OutOfBox/.netscape/plugin-list $HOME/.netscape/plugin-list
  97.  
  98. # Get the Xdefaults file so that the File->Exit menu is available
  99. /bin/cp /CDROM/misc/cgiXdefaults $HOME/.Xdefaults
  100. /sbin/chown nobody.nobody $HOME/.Xdefaults
  101.  
  102. # set up tardist info
  103. # SoftwareManager needs to run as a user so running as OutOfBox
  104. # SM. also needs display set since nobody doesn't have it set.
  105. /sbin/echo 'application/x-tardist; su - OutOfBox -c "/usr/sbin/SoftwareManager -a -f %s -- -display localhost:0.0"; description="SGI software distribution archive"' > $HOME/.mailcap
  106. /sbin/echo 'type=application/x-tardist  exts=tardist      icon=internal-gopher-unknown' > $HOME/.mime.types
  107. /sbin/chown nobody.nobody $HOME/.mailcap $HOME/.mime.types
  108.  
  109. # Before the user starts System Setup, get rid of the lock file so
  110. #    that we don't get an error next time we start.  (Netscape only
  111. #    removes the lock when you quit via File->Exit.)
  112. #    The lock is actually a link, so we check for "-l"
  113. if [ -l $HOME/.netscape/lock ]; then    
  114.     /sbin/rm $HOME/.netscape/lock
  115. fi
  116.  
  117.  
  118.  
  119. # Check to be sure that we have the correct Netscape version number
  120. #   in our preferences file; we don't want the customers to see
  121. #   the license agreement window...
  122.  
  123. /usr/people/OutOfBox/bin/netscapeVsn.pl -l nobody -h $HOME
  124.  
  125.  
  126. case "$NSVERSION" in
  127.    *Communicator*)
  128.       # run app in background
  129.       `/var/www/htdocs/Register/Register_To_Win -oobe`;
  130.       ;;
  131.    *Navigator*|*)
  132.       # run app in background
  133.       `/var/www/htdocs/Register/Register_To_Win -oobe`;
  134.       ;;
  135. esac
  136.  
  137.  
  138.  
  139. # turn the area black again.                                  
  140. /sbin/echo "<html>\n";                                        
  141. /sbin/echo "<body bgcolor=\"#000000\">\n";                    
  142. /sbin/echo "</body>\n";                                       
  143. /sbin/echo "</html>\n";              
  144.  
  145.  
  146. # After the System Setup has quit, clean up the temporary home directory 
  147. if [  -d $HOME ]; then
  148.     /bin/rm -rf $HOME
  149. fi
  150.